package com.linewell.dao.impl;

import com.linewell.dao.PointMapper;
import com.linewell.entity.CommentPoint;
import com.linewell.entity.Point;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Title: ssm2
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2018/2/12
 */
@Repository
public class PointDao implements PointMapper{

    @Autowired
    PointMapper pointMapper;

    public void insertPoint(Long userId, Long pointId) {
        pointMapper.insertPoint(userId,pointId);
    }

    public List<Point> isExistPoint(Long userId, Long pointId) {
        return pointMapper.isExistPoint(userId,pointId);
    }

    public void updateZanOrCai(Long pointId, int newZanNum, int newCaiNum) {
         pointMapper.updateZanOrCai(pointId,newZanNum,newCaiNum);
    }

    public void updatePoint(Long userId, Long pointId, int isFavorType) {
        pointMapper.updatePoint(userId,pointId,isFavorType);
    }

    public void updatePointCollect(Long userId, Long pointId, int isCollectType) {
        pointMapper.updatePointCollect(userId,pointId,isCollectType);
    }

    public void updateCollectNum(int collectNum,Long pointId) {
        pointMapper.updateCollectNum(collectNum,pointId);
    }

    public Point checkCollectType(Long userId, Long pointId) {
        return pointMapper.checkCollectType(userId,pointId);
    }

    public List<CommentPoint> checkIsCommentFavor(Long replyId, Long userId) {
        return pointMapper.checkIsCommentFavor(replyId,userId);
    }

    public void insertCommentPoint(Long replyId, Long userId) {
        pointMapper.insertCommentPoint(replyId,userId);
    }

    public void updateReplyZanOrCai(Long replyId, int zanNum, int caiNum) {
        pointMapper.updateReplyZanOrCai(replyId,zanNum,caiNum);
    }

    public void updateCommentPoint(Long replyId, Long userId, int isFavorType) {
        pointMapper.updatePoint(replyId,userId,isFavorType);
    }

    public void insertCollect(Long pointId, Long userId) {
        pointMapper.insertCollect(pointId,userId);
    }

    public void deleteCollect(Long pointId, Long userId) {
        pointMapper.deleteCollect(pointId,userId);
    }
}
